
const mysql = require('mysql')

const dotenv = require('./config.default')

const { HOST, ROOT, USER_NAME, PASS_WORD, DATA_BASE } = dotenv || {}

// mysql 数据连接池

const pool = mysql.createPool({
    connectionLimit: 10,
    host: HOST, // 连接的服务器
    port: ROOT, // mysql端口号
    database: DATA_BASE,//要链接的库
    user: USER_NAME,
    password: PASS_WORD
})

module.exports = { pool }